<script>
// 顶部tab+页面切换
import { defineComponent } from 'vue'
export default defineComponent({
	name: 'WeworkQr'
})
</script>
<script setup>
import { ref } from 'vue'
import { toRaw } from '@vue/reactivity'
import base1 from './detail/base.vue'
import table1 from './detail/table.vue'
import Customer from './detail/customer.vue'
import Detail1 from '@/pages/wework/customer/detail/index.vue'
const dialogVisible = ref(false)
const detail1 = ref(null)
const baseRef = ref(null)
const tableRef = ref(null)
const tableRef1 = ref(null)
const isShowDetail = ref(false)

const show = (id)=>{
  dialogVisible.value = true
	setTimeout(()=>{
		baseRef.value.show(id)
		tableRef.value.show(id)
		tableRef1.value.show(id)
	},50)
}
const showDetail = (val)=>{
  console.log('客户详情')
  isShowDetail.value = true
	setTimeout(()=>{
		detail1.value.show(val)
	},5)
}
const emits = defineEmits(['goBack'])
defineExpose({
	show
})
</script>
<template>
	<div v-if="dialogVisible"> 
		<div v-if="!isShowDetail">
    <div class="app-back-tab">
			<div class="app-flex-left">
				<span class="back-box app-pointer" @click="dialogVisible=false;emits('goBack')">
					<MyIcon class="app-icon " name="Back" />
					<span class="back-box-mr">返回</span>
				</span>
				<span class="back-box-gap">|</span>
				<span class="back-title">群发详情</span>
			</div>
		</div>
      <base1 ref="baseRef" />
			<div class="app-flex-left">
			 <table1 style="width:100%" ref="tableRef"  @showDetail="showDetail($event,val)" />
			  <customer style="width:100%" ref="tableRef1"  @showDetail="showDetail($event,val)" />
			</div>
     
    </div>
    <Detail1 ref="detail1" @diaUpdate="dialogVisible=true" />
		
	</div>
</template>
<style lang="scss">
@import url('../../../style/app-component.scss');
.el-page-header {
  display:none;
}
</style>
